# encoding: utf-8
import os

from datetime import datetime
from google.appengine.api import users
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import template

class BaseRequestHandler(webapp.RequestHandler):
	"""Base classs"""
	def generate(self, template_name, template_values={}):
		values = {
		}
		values.update(template_values)
		directory = os.path.dirname(__file__)
		path = os.path.join(directory, os.path.join('templates', template_name))
		self.response.out.write(template.render(path, values))

class error_base(BaseRequestHandler):
	def get(self,value=None):
		value = {'error': 'error:not fount the page! &nbsp; 错误：未找到此页面！'}
		self.generate('error_base.html', value)
	def post(self,value=None):
		value = {'error': 'error:not fount the page! &nbsp; 错误：未找到此页面！'}
		self.generate('error_base.html', value)

def main():
	application = webapp.WSGIApplication([
		('/(.*)', error_base)
	],debug=True)
	run_wsgi_app(application)

if __name__ == "__main__":
	main()
